package ch.fusun.baron.player.api;

import java.util.Map;

import ch.fusun.baron.core.injection.Inject;
import ch.fusun.baron.core.rmi.User;
import ch.fusun.baron.data.DataUpdate;
import ch.fusun.baron.player.Dynasty;

/**
 * Update object for {@link PlayerService}
 */
public class PlayerUpdate implements DataUpdate {

	@Inject
	private transient PlayerService service;

	private Map<Dynasty, User> dynasties;

	/**
	 * Don't use this manually
	 */
	public PlayerUpdate() {
	}

	/**
	 * Constructor
	 * 
	 * @param dynasties
	 */
	public PlayerUpdate(Map<Dynasty, User> dynasties) {
		this.dynasties = dynasties;
	}

	@Override
	public void update() {
		service.setDynasties(this.dynasties);
	}
}
